﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SAD.Server.FormServer
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            btnStart.Enabled = false;
            SAD.DataCenter.MainActivator.Current.Start();
            ss();
        }


        private void btnStop_Click(object sender, EventArgs e)
        {
            btnStop.Enabled = false;
            SAD.DataCenter.MainActivator.Current.Stop();
            ss();
        }

        private void ss()
        {
            if (SAD.DataCenter.MainActivator.Current.Prepared)
            {
                btnStart.Enabled = false;
                btnStop.Enabled = true;
            }
            else
            {
                btnStart.Enabled = true;
                btnStop.Enabled = false;
            }
        }

        private void btnSend_Click(object sender, EventArgs e)
        {
            SAD.DataCenter.InfoManager.Instance.SendInfo(1, 1, SAD.Common.Enums.Info_ShowType.NormalText, tbMessage.Text, 0, SAD.Common.Enums.Info_SourceType.SMS, tbPhone.Text);
        }

    }
}
